/*
 * SpringWicketApplication.java
 *
 * Created on 2 mars 2011, 08:20
 */
 
package com.blog.dev.springwicket.web;

import org.apache.wicket.authentication.AuthenticatedWebApplication;
import org.apache.wicket.authentication.AuthenticatedWebSession;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.spring.injection.annot.SpringComponentInjector;



/** 
 *
 * @author mbenrhouma
 * @version 
 */

public class SpringWicketApplication extends AuthenticatedWebApplication {



    boolean isInitialized = false;


    @Override
    protected void init() {
        if (!isInitialized) {
            super.init();
            setListeners();
            isInitialized = true;
        }
    }
private void setListeners() {
        addComponentInstantiationListener(new SpringComponentInjector(this));
    }

    public Class getHomePage() {
        return LoginPage.class;
    }

    @Override
    protected Class<? extends AuthenticatedWebSession> getWebSessionClass() {
        return SpringWicketWebSession.class;
    }

    @Override
    protected Class<? extends WebPage> getSignInPageClass() {
        return LoginPage.class;
    }
}
